//
//  TLUserData.m
//  TLKeepCredit
//
//  Created by mac on 16/10/11.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "TLUserData.h"

@implementation TLUserData

static TLUserData *__instanceObj = nil;



/**
 sharesuerdata

 @return btn sdf
 */
+ (instancetype)shareUserData
{
//    static id __instanceObj = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        __instanceObj = [[self alloc] init];
    });
    return __instanceObj;
}

+ (void)loginSucWithModel:(TLUserModel *)userModel {
    [[TLUserData shareUserData] setUserModel:userModel];
    
}

+ (BOOL)hasLogin{
    return __instanceObj.userModel?YES:NO;
}
+(void)logout{
    __instanceObj.userModel = nil;
}

- (NSString *)user_id{
    if(_userModel.ID){
        return _userModel.ID;
    }
    return @"";
}




@end
